package com.adv.ems.controller.client;

import com.adv.ems.constants.SystemConst;
import com.adv.ems.model.dto.APIResponse;
import com.adv.ems.model.vo.FullIndexBasicInfoVO;
import com.adv.ems.model.vo.FullWarningInfoVO;
import com.adv.ems.service.FullScreenService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

@RestController
@RequestMapping("/ems/client/fullscreen")
public class FullScreenController {
    @Resource
    FullScreenService fullScreenService;

    @PostMapping("/basic/info")
    public APIResponse<FullIndexBasicInfoVO> basicInfo(@RequestHeader(name = SystemConst.Header.ACCEPT_LANGUAGE, defaultValue = SystemConst.Header.ZH_CN) String acceptLanguage) {
        return APIResponse.<FullIndexBasicInfoVO>build().content(fullScreenService.basicInfo(acceptLanguage));
    }

    @PostMapping("/warning")
    public APIResponse<FullWarningInfoVO> warning(@RequestHeader(name = SystemConst.Header.ACCEPT_LANGUAGE, defaultValue = SystemConst.Header.ZH_CN) String acceptLanguage) {
        return APIResponse.<FullWarningInfoVO>build().content(fullScreenService.warning(acceptLanguage));
    }
}
